import '../nav/nav.css'
import nav from '../../templace/nav/nav.tet'
document.querySelector('#menu').innerHTML = nav

const arr_dt = document.querySelectorAll('dt')
const arr_a = document.querySelectorAll('a')

import add_tab_title from '../tab_title/tab_title'
import add_tab_content from '../tab_content/tab_content'

arr_dt.forEach(item => {
  //点击左侧出现列表
  item.onclick = function () {
    if (this.nextElementSibling.style.display != 'block') {
      this.nextElementSibling.style.display = 'block'
    }
    else {
      this.nextElementSibling.style.display = 'none'
    }
  }
})
arr_a.forEach(item => {
  //点击左侧选项将选项属性和内容传入
  item.onclick = function (e) {
    add_tab_title(e.target.dataset.template, e.target.innerHTML)
    add_tab_content(e.target.dataset.template, e.target.innerHTML)
  }
})